package com.hellpro.lolbox.home;


import com.google.gson.Gson;

import java.lang.reflect.Type;

/**
 * Package_Name: com.hellpro.lolbox.home
 * Description :
 * author: HellPermanent
 * date:  2016/10/20 1:25
 * remarks：
 */
public class HomeJsonUtils {
    public static <T> T getData (String json, Class<T> tClass)  {

        Gson gson = new Gson();
if (json!=null){
        T t = gson.fromJson(json, tClass);
            return  t ;
        }
return  null;
    }

    //Gson解析最外层是[];
    public static Object getArrayData (String json, Type type){
        Gson gson = new Gson();
        if (json!=null){
            Object o = gson.fromJson(json, type);
             return o;
        }
        return null;
    }
}
